package com.syezon.wifikey.base;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.support.annotation.NonNull;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;


import com.syezon.wifikey.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import pl.droidsonroids.gif.GifImageView;

public class LoaddingDialog extends Dialog {

    @BindView(R.id.gifView)
    GifImageView mGifView;

    @BindView(R.id.tv_loadding)
    TextView mTvLoadding;

    public static void showLoadding(Context context) {
        LoaddingDialog countDialog = new LoaddingDialog(context);
        countDialog.show();
    }

    public LoaddingDialog(@NonNull Context context) {
        super(context);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.app_loadding);
        ButterKnife.bind(this);
        getWindow().setDimAmount(0.5f);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        setCanceledOnTouchOutside(false);
//        mGifView.setImageResource(R.drawable.app_loading_gif);
        getWindow().setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
    }


//    @OnClick({R.id.iv_close})
//    public void onViewClicked(View view) {
//        switch (view.getId()) {
//            case R.id.iv_close:
//                dismiss();
//                break;
//        }
//    }
}
